﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyInvoice.WPF.Common
{
    public static class Utils
    {
        public static string ConvertToSHA512(string stringToBeHashed)
        {
            string returnString = string.Empty;
            using (System.Security.Cryptography.SHA512Managed sha = new System.Security.Cryptography.SHA512Managed())
            {
                byte[] byteResult = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(stringToBeHashed));
                returnString = "{SHA-512}" + System.Convert.ToBase64String(byteResult);
            }
            return returnString;
        }
    }
}
